package com.info.zhiduoduo.common.excelconverter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * 创客企业普通项目状态： 1草稿 2待发布 4已发布 6竞标中(创客已投标) 7竞标失败 8竞标结束 10进行中 12验收中 13 验收完成 14 拒绝验收 15:线下支付中 20已完成 40已取消 44删除
 */
public class ProjectStateConverter implements Converter<Integer> {

	@Override
	public Class supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty,
	                                 com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) throws Exception {
		return 0;
	}

	@Override
	public CellData convertToExcelData(Integer integer, ExcelContentProperty excelContentProperty,
	                                   com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) throws Exception {
		if (integer == null) {
			return new CellData("");
		} else if (integer == 1) {
			return new CellData("草稿");
		} else if (integer == 2) {
			return new CellData("待发布");
		} else if (integer == 3) {
			return new CellData("发布失败");
		} else if (integer == 4) {
			return new CellData("已发布");
		} else if (integer == 6) {
			return new CellData("竞标中");
		} else if (integer == 7) {
			return new CellData("竞标失败");
		} else if (integer == 8) {
			return new CellData("竞标结束");
		} else if (integer == 10) {
			return new CellData("进行中");
		} else if (integer == 12) {
			return new CellData("验收中");
		} else if (integer == 13) {
			return new CellData("验收完成");
		} else if (integer == 14) {
			return new CellData("拒绝验收");
		}  else if (integer == 15) {
			return new CellData("线下支付中");
		} else if (integer == 20) {
			return new CellData("已完成");
		} else if (integer == 40) {
			return new CellData("已取消");
		} else if (integer == 44) {
			return new CellData("删除");
		} else if (integer == 21) {
			return new CellData("作废");
		} else {
			return new CellData("");
		}
	}
}
